<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>VUE 组件</title>
    <link rel="stylesheet" href="../font-awesome-4.7.0/css/font-awesome.min.css">
</head>

<body>
    <div id="app"></div>
    <script src="../vue.js"></script>
    <script src="../vue-router.js"></script>
    <script src="../httpVueLoader.js"></script>
    <script>
        // 在 vue 中启用路由
        Vue.use(VueRouter);

        const myapp = httpVueLoader("./App.vue");
        const Welcome = httpVueLoader("./Welcome.vue");
        const GoodsManager = httpVueLoader("./GoodsManager.vue");
        const GoodsManager1 = httpVueLoader("./GoodsManager1.vue");

        // 创建 Vue 的路由的实例
        const router = new VueRouter({
            // 声明路由表
            routes: [
                { path: "/", component: Welcome },
                { path: "/gm", component: GoodsManager },
                { path: "/gm1", component: GoodsManager1 },
            ]
        });

        new Vue({
            router,// (缩写) 相当于 router: router
            render: (h) => h(myapp)
        }).$mount("#app");
    </script>
</body>

</html>